package com.shuyuansystem.service.impl;

import com.shuyuansystem.dao.MerchantProductsMapper;
import com.shuyuansystem.dao.merchantProductMapper;
import com.shuyuansystem.service.MerchantProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MerchantProductServiceImpl implements MerchantProductService {
    @Autowired
    private MerchantProductsMapper merchantProductsMapper;
    @Autowired
    private merchantProductMapper merchantProductMapper;
    @Override
    public List<Integer> getProductIdsByUserId(int userId) {
        return merchantProductsMapper.getProductIdsById(userId);
    }
    @Override
    public boolean addMerchantProductAssociation(int userId, int productId) {
        int rows = merchantProductMapper.addMerchantProductAssociation(userId, productId);
        return rows > 0;
    }

}
